﻿using System;
using System.Collections.Generic;
using System.Linq;
using Sendz.Domain;

namespace Sendz.Model
{
    public interface IFormRepository
    {
        #region Forms /////////////////////////////

        List<Form> GetFormsByUserKey(Guid userKey);

        Form GetFormByKey(Guid formKey);
        
        Form GetFormByShortPath(string shortpath);

        bool SaveForm(Form form);

        bool RemoveForm(Guid formKey);

        bool RemoveField(Guid formFieldKey);

        bool SaveField(Guid formKey, FormField formField);

        List<FormField> GetFieldsByFormKey(Guid formKey);

        FormField GetFieldByKey(Guid fieldKey);

        List<Form> GetFormsUsingAutoResponder(Guid autoResponderKey);

        #endregion

        #region Field Types ///////////////////////////////

        List<FieldType> GetFieldTypes();

        FieldType GetFieldTypeByKey(Guid fieldTypeKey);

        FieldType GetFieldTypeByListEnum(string listEnum);
        
        #endregion

        #region Responses ///////////////////////////////

        Guid CreateResponseWithItems(Guid formKey, List<Tuple<Guid, string>> responseItems);

        List<Response> GetResponsesByFormKey(Guid formKey);

        List<ResponseItem> GetResponseItemsByKey(Guid responseKey);

        Response GetResponseByKey(Guid responseKey);

        Identity GetIdentityByKey(Guid identityKey);

        bool LogAutoResponse(Guid autoResponderKey, Guid identityKey);

        #endregion

    }
}
